#!/bin/sh -e
#
#  install the Utilization LED Display daemon


if grep -q 'utilization' /etc/rc.local; then
   # string found
   echo "Error: utilization appears to already be installed"
   echo "  do"
   echo "     sudo ./uninstall"
   echo "  and try again"
   echo " "
   exit 1
else
   # string not found
   echo "  Install Utilization LED Display daemon"
   cp utilization /usr/local/bin
   chmod 755 /usr/local/bin/utilization
   sed -i -e '$ i \/usr/local/bin/utilization\n' /etc/rc.local
   exit 0
fi
